use core::sync::atomic::Ordering;

use crate::arch::ENABLE_INTERRUPT;

#[unsafe(no_mangle)]
extern "C" fn kmain() -> ! {
    super::kmm::init();

    crate::klog::init();

    info!("Unicore starting...");

    super::trap::init();

    super::context::init();

    super::enter_to_module();

    ENABLE_INTERRUPT.store(true, Ordering::SeqCst);
    loop {
        x86_64::instructions::interrupts::enable_and_hlt();
    }
}
